package com.ruoyi.mentor.service.impl;

import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.core.page.PagePlus;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.utils.PageUtils;
import com.ruoyi.mentor.domain.StuMemberInfo;
import com.ruoyi.mentor.mapper.StuMemberInfoMapper;
import com.ruoyi.mentor.service.IStuMemberInfoService;
import com.ruoyi.mentor.vo.StuMemberInfoVo;
import org.springframework.stereotype.Service;

import java.util.Collection;
import java.util.List;
import java.util.Map;

/**
 * 研究生家庭信息Service业务层处理
 *
 * @author LH
 * @date 2021-05-21
 */
@Service
public class StuMemberInfoServiceImpl extends ServiceImpl<StuMemberInfoMapper, StuMemberInfo> implements IStuMemberInfoService {

    @Override
    public StuMemberInfoVo queryById(Long id){
        return getVoById(id, StuMemberInfoVo.class);
    }



    /**
     * 保存前的数据校验
     *
     * @param entity 实体类数据
     */
    private void validEntityBeforeSave(StuMemberInfo entity){
        //TODO 做一些数据校验,如唯一约束
    }

    @Override
    public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
        if(isValid){
            //TODO 做一些业务上的校验,判断是否需要校验
        }
        return removeByIds(ids);
    }
}
